import request from "@/utils/request.js"

const API = {
  SAVE: '/voucher',
  DELETE: '/voucher',
  UPDATE: '/voucher',
  BAN: '/voucher/ban',
  PAGE: '/voucher/page',
  LIST: '/voucher/list/name',
}

export const reqSaveVoucher = (param) => request.post(API.SAVE, param)
export const reqDeleteVoucher = (id) => request.delete(API.DELETE, {params: {id}})
export const reqUpdateVoucher = (param) => request.put(API.UPDATE, param)
export const reqBanVoucher = (id, banFlag) => request.put(API.BAN, null, {params: {id, banFlag}})
export const reqPageVoucher = (pn, ps, name, serial) => request.get(API.PAGE, {params: {pn, ps, name, serial}})
export const reqListVoucher = () => request.get(API.LIST)
